{extend name="common@base" /}
{block name="content"}
<section class="content">
  <div class="row">
    <div class="col-xs-12">
      <div class="box box-gray">
        <form class="form" method="get">
          <div class="box-body">
            <div class="form-group">
              <label for="">
                类型{:form_dropdown('search[type]',$qType,$search ? $search['type'] : -1,'class="form-control"')}
              </label>
              <label for="">
                题目<input type="text" name="search[content]" value="{$search.content}" class="form-control">
              </label>
              <button type="submit" class="btn btn-default btn-sm">查询</button>
            </div>
          </div>
        </form>
      </div>
      <div class="box box-primary">
        <div class="box-header with-border">
          <div class="box-title">题目管理</div>
          <div class="pull-right">
            <a href="{:url('edit')}" class="btn btn-primary">新增</a>
            <a href="{:url('import')}" class="btn btn-default">导入</a>
          </div>

        </div>
        <div class="box-body">
          <table id="table" class="table">
            <thead>
            <tr>
              <th width="5%">ID</th>
              <th width="5%">类型</th>
              <th>内容</th>
              <th>创建时间</th>
              <th width="5%">创建人</th>
              <th width="5%">状态</th>
              <th width="10%">操作</th>
            </tr>
            </thead>
            <tbody>
            {foreach $rows as $row}
            <tr>
              <td>{$row.id}</td>
              <td>{$qType[$row.type]}</td>
              <td>{$row.content}</td>
              <td>{$row.create_time}</td>
              <td>{$row.realname}</td>
              <td><span class="{$row.disable ? 'text-danger' : 'text-success'}">{$row.disable_text}</span></td>
              <td>
                <a href="{:url('edit',['id'=>$row.id])}" class="btn btn-xs btn-default">编辑</a>
                <a href="{:url('disable',['id'=>$row.id])}"
                   class="btn btn-xs js-confirm {$row.disable ? 'btn-success' : 'btn-danger'}">
                  {$row.disable ? '启用' : '禁用'}
                </a>
              </td>
            </tr>
            {/foreach}
            </tbody>
          </table>
        </div>
        <div class="box-footer">
          {$rows->render()}
        </div>
      </div>
    </div>
  </div>
</section>
{/block}
{block name="page_script"}
<script>
  require(["layer_config", "ajaxForm",], function (layer) {

  });
</script>
{/block}





